#include "fxcc/yml/Serializer.h"
#include "fxcc/core/FileHeader.h"

using namespace fxcc;
using namespace fxcc::yml;

template<>
void Serializer::Encode<FileHeader>(YAML::Node& node, const FileHeader& inst)
{

	SetVariable<std::string>(node, "CreateBy", inst.m_CreateBy);
	SetVariable<std::string>(node, "UpdateBy", inst.m_UpdateBy);
	SetVariable<std::string>(node, "Path", inst.m_Path);
	SetVariable<std::string>(node, "Filename", inst.m_Filename);
	SetVariable<int>(node, "CreateTime", inst.m_CreateTime);
	SetVariable<int>(node, "UpdateTime", inst.m_UpdateTime);

}


template<>
bool Serializer::Decode<FileHeader>(const YAML::Node& node, FileHeader& inst)
{
	GetVariable<std::string>(node, "CreateBy", inst.m_CreateBy);
	GetVariable<std::string>(node, "UpdateBy", inst.m_UpdateBy);
	GetVariable<std::string>(node, "Path", inst.m_Path);
	GetVariable<std::string>(node, "Filename", inst.m_Filename);
	GetVariable<int>(node, "CreateTime", inst.m_CreateTime);
	GetVariable<int>(node, "UpdateTime", inst.m_UpdateTime);
	return true;

}